package kr.co.happenstance.lib;

import java.net.URL;

import kr.co.happenstance.C;
import kr.co.happenstance.http.HttpRequestor;
import kr.co.happenstance.lib.vo.LibResultVo;
import kr.co.happenstance.lib.vo.NoticeInfoResultVo;
import kr.co.happenstance.lib.vo.NoticeListResultVo;

public class NoticeLib extends CommonLib {

	public LibResultVo list(int currentPage) throws Exception{
		LibResultVo resultVo = null;
		
		try{
			httpRequestor =  new HttpRequestor(new URL(C.API_URL_NOTICE_LIST));
			httpRequestor.addParameter("currentPage", Integer.toString(currentPage));
			resultVo = super.send(NoticeListResultVo.class);
			
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return resultVo;
	}	
	
	public LibResultVo info(int seq) throws Exception{
		LibResultVo resultVo = null;
		
		try{
			httpRequestor =  new HttpRequestor(new URL(C.API_URL_NOTICE_INFO));
			httpRequestor.addParameter("seq", Integer.toString(seq));
			resultVo = super.send(NoticeInfoResultVo.class);
			
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return resultVo;
	}		
	
}
